from django.urls import path
from rest_framework import routers
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView, TokenVerifyView

from user import views
from user.views import RegisterAPIView, HistoryChainAPIView, GoodsShowAPIView, GoodsModelViewSet, BannersAPIView, \
    DetailGoodsAPIView, ShopListAPIView

router = routers.DefaultRouter()
router.register('goods', GoodsModelViewSet)

urlpatterns = router.urls + [
    path('register/', RegisterAPIView.as_view()),
    path('access_token/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
    path('refresh', TokenRefreshView.as_view(), name='token_refresh'),
    path('verify/', TokenVerifyView.as_view(), name='token_verify'),
    path('xx/', HistoryChainAPIView.as_view()),
    path('xxx/', GoodsShowAPIView.as_view()),
    path('banner/', BannersAPIView.as_view()),
    path('shop/', ShopListAPIView.as_view()),
    # path('detail/<int:pk>/', DetailGoodsAPIView.as_view()),
    path('detail/', DetailGoodsAPIView.as_view()),
]
